import 'package:flutter/services.dart';
enum ClassStatus {
  CLASS_PREPARE,
  CLASS_ONGOING,
  CLASS_OVER,
  CLASS_EXPIRE
}

class NativeChannelUtil{

  static const String NATIVE_CHANNEL = "com.xueda.xdzx/channel";
  static const String OPEN_CLASS_ROOM = "com.xueda.xdzx/channel/open_class_room";
  static const String EYE_PROTECTION_MODE = "com.xueda.xdzx/channel/eye_protection_mode";
  static const String OPEN_EMAIL = "com.xueda.xdzx/channel/open_email";

  static const platform = MethodChannel(NATIVE_CHANNEL);

  static Future<int?> invokeNativeMethod(String method,{Map<String,dynamic>? param}) async {
    try{
      return await platform.invokeMethod(method,param);
    }on PlatformException catch(e){
      print("NativeChannelUtil : $e");
    }
  }

  /// 打开邮箱
  static Future<int?> openEmail(String emailAddress) async{
    Map<String,dynamic> map = new Map();
    map["email_address"] = emailAddress;
    invokeNativeMethod(OPEN_EMAIL,param : map);

  }
}